package con.shopping.entity;

/**
 * 优惠券
 * @author ：河神
 * @date ：Created in 2022/2/14 8:10 下午
 */
public class Coupon extends Active{



    //满多少
    private double condition;
    //减多少
    private double reduceMoney;

    public Coupon(ActiveTime activeTime, double condition, double reduceMoney) {
        super(activeTime);
        this.condition = condition;
        this.reduceMoney = reduceMoney;

    }

    public double countCoupon(double price){
        if (price>condition){
            return price-reduceMoney;
        }
        return price;
    }

}
